package com.itheima;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

//@SpringCloudApplication 里面包含下面三个注解
@SpringBootApplication
@EnableDiscoveryClient//eureka客户端
@EnableCircuitBreaker
@EnableFeignClients //开启Feign支持,扫描到加了@FeignCLient注解接口 产生代理对象
public class ConsumerApplication {
    public static void main(String[] args) {
        SpringApplication.run(ConsumerApplication.class,args);

    }
    @Bean
    @LoadBalanced
    public RestTemplate restTemplate()
    {
        return new  RestTemplate();
    }
}
